home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / BreakLines.c < prev    next >
MacBinary  |  1994-07-29  |  4.0 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: BreakLines.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Fri Jul 29 02:44:27 1994, modified Fri Jul 29 02:44:27 1994, creator 'CWIE', type ASCII, 3431 bytes "BreakLines.c" , at 0xde7 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 42 72 65 61 6b 4c | 69 6e 65 73 2e 63 00 00 |..BreakL|ines.c..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 0d 67 00 | 00 01 9a aa 5e 55 cb aa |......g.|....^U..|
|00000060| 5e 55 cb 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |^U......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 39 13 00 00 |........|....9...|
|00000080| 2f 2a 0d 42 72 65 61 6b | 4c 69 6e 65 73 2e 63 0d |/*.Break|Lines.c.|
|00000090| 0d 09 63 68 61 72 20 2a | 42 72 65 61 6b 4c 69 6e |..char *|BreakLin|
|000000a0| 65 73 28 63 68 61 72 20 | 2a 73 74 72 69 6e 67 2c |es(char |*string,|
|000000b0| 6c 6f 6e 67 20 6c 69 6e | 65 4c 65 6e 67 74 68 29 |long lin|eLength)|
|000000c0| 3b 0d 54 61 6b 65 73 20 | 61 20 6c 6f 6e 67 20 43 |;.Takes |a long C|
|000000d0| 20 73 74 72 69 6e 67 20 | 61 6e 64 20 6a 75 64 69 | string |and judi|
|000000e0| 63 69 6f 75 73 6c 79 20 | 63 68 61 6e 67 65 73 20 |ciously |changes |
|000000f0| 73 70 61 63 65 73 20 74 | 6f 20 27 5c 6e 27 20 74 |spaces t|o '\n' t|
|00000100| 6f 20 79 69 65 6c 64 20 | 6c 69 6e 65 73 0d 73 68 |o yield |lines.sh|
|00000110| 6f 72 74 65 72 20 74 68 | 61 6e 20 6c 69 6e 65 4c |orter th|an lineL|
|00000120| 65 6e 67 74 68 2c 20 62 | 75 74 20 77 6f 72 64 73 |ength, b|ut words|
|00000130| 20 61 72 65 20 6e 65 76 | 65 72 20 62 72 6f 6b 65 | are nev|er broke|
|00000140| 6e 2c 20 65 76 65 6e 20 | 69 66 20 74 68 65 79 20 |n, even |if they |
|00000150| 61 72 65 20 6c 6f 6e 67 | 65 72 0d 74 68 61 6e 20 |are long|er.than |
|00000160| 6c 69 6e 65 4c 65 6e 67 | 74 68 2e 20 41 6c 6c 20 |lineLeng|th. All |
|00000170| 63 68 61 72 61 63 74 65 | 72 73 20 6f 74 68 65 72 |characte|rs other|
|00000180| 20 74 68 61 6e 20 73 70 | 61 63 65 20 61 6e 64 20 | than sp|ace and |
|00000190| 27 5c 6e 27 20 61 72 65 | 20 74 72 65 61 74 65 64 |'\n' are| treated|
|000001a0| 20 61 73 20 6c 65 74 74 | 65 72 73 2e 0d 45 2e 67 | as lett|ers..E.g|
|000001b0| 2e 09 70 72 69 6e 74 66 | 28 22 25 73 5c 6e 22 2c |..printf|("%s\n",|
|000001c0| 42 72 65 61 6b 4c 69 6e | 65 73 28 73 74 72 69 6e |BreakLin|es(strin|
|000001d0| 67 2c 38 30 29 29 3b 0d | 0d 09 76 6f 69 64 20 50 |g,80));.|..void P|
|000001e0| 72 69 6e 74 57 72 61 70 | 70 65 64 54 65 78 74 28 |rintWrap|pedText(|
|000001f0| 46 49 4c 45 20 2a 73 74 | 72 65 61 6d 2c 63 6f 6e |FILE *st|ream,con|
|00000200| 73 74 20 63 68 61 72 20 | 2a 73 29 3b 0d 50 72 69 |st char |*s);.Pri|
|00000210| 6e 74 73 20 6f 75 74 20 | 74 65 78 74 2c 20 77 69 |nts out |text, wi|
|00000220| 74 68 20 77 6f 72 64 20 | 77 72 61 70 70 69 6e 67 |th word |wrapping|
|00000230| 2e 20 4c 65 61 76 65 73 | 20 74 68 65 20 73 75 70 |. Leaves| the sup|
|00000240| 70 6c 69 65 64 20 73 74 | 72 69 6e 67 20 75 6e 6d |plied st|ring unm|
|00000250| 6f 64 69 66 69 65 64 2e | 0d 0d 09 76 6f 69 64 20 |odified.|...void |
|00000260| 50 72 69 6e 74 57 72 61 | 70 70 65 64 54 65 78 74 |PrintWra|ppedText|
|00000270| 54 6f 46 69 6c 65 28 63 | 6f 6e 73 74 20 63 68 61 |ToFile(c|onst cha|
|00000280| 72 20 2a 66 69 6c 65 6e | 61 6d 65 2c 63 6f 6e 73 |r *filen|ame,cons|
|00000290| 74 20 63 68 61 72 20 2a | 73 29 3b 0d 41 70 70 65 |t char *|s);.Appe|
|000002a0| 6e 64 73 20 77 72 61 70 | 70 65 64 20 74 65 78 74 |nds wrap|ped text|
|000002b0| 20 74 6f 20 61 20 66 69 | 6c 65 2e 0d 0d 09 76 6f | to a fi|le....vo|
|000002c0| 69 64 20 50 72 69 6e 74 | 57 72 61 70 70 65 64 43 |id Print|WrappedC|
|000002d0| 6f 6d 6d 65 6e 74 28 46 | 49 4c 45 20 2a 73 74 72 |omment(F|ILE *str|
|000002e0| 65 61 6d 2c 63 6f 6e 73 | 74 20 63 68 61 72 20 2a |eam,cons|t char *|
|000002f0| 73 29 3b 0d 45 6e 63 6c | 6f 73 65 73 20 74 68 65 |s);.Encl|oses the|
|00000300| 20 73 74 72 69 6e 67 20 | 73 20 69 6e 73 69 64 65 | string |s inside|
|00000310| 20 63 6f 6d 6d 65 6e 74 | 20 64 65 6c 69 6d 69 74 | comment| delimit|
|00000320| 65 72 73 20 61 6e 64 20 | 70 72 69 6e 74 73 20 69 |ers and |prints i|
|00000330| 74 20 77 69 74 68 20 77 | 6f 72 64 20 77 72 61 70 |t with w|ord wrap|
|00000340| 70 69 6e 67 2e 0d 0d 09 | 76 6f 69 64 20 50 72 69 |ping....|void Pri|
|00000350| 6e 74 57 72 61 70 70 65 | 64 43 6f 6d 6d 65 6e 74 |ntWrappe|dComment|
|00000360| 54 6f 46 69 6c 65 28 63 | 6f 6e 73 74 20 63 68 61 |ToFile(c|onst cha|
|00000370| 72 20 2a 66 69 6c 65 6e | 61 6d 65 2c 63 6f 6e 73 |r *filen|ame,cons|
|00000380| 74 20 63 68 61 72 20 2a | 73 29 3b 0d 45 6e 63 6c |t char *|s);.Encl|
|00000390| 6f 73 65 73 20 74 68 65 | 20 73 74 72 69 6e 67 20 |oses the| string |
|000003a0| 73 20 69 6e 73 69 64 65 | 20 63 6f 6d 6d 65 6e 74 |s inside| comment|
|000003b0| 20 64 65 6c 69 6d 69 74 | 65 72 73 20 61 6e 64 20 | delimit|ers and |
|000003c0| 61 70 70 65 6e 64 73 20 | 69 74 20 74 6f 20 61 20 |appends |it to a |
|000003d0| 66 69 6c 65 2c 0d 77 69 | 74 68 20 77 6f 72 64 20 |file,.wi|th word |
|000003e0| 77 72 61 70 70 69 6e 67 | 2e 0d 0d 09 54 68 65 20 |wrapping|....The |
|000003f0| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 73 79 6d |preproce|ssor sym|
|00000400| 62 6f 6c 20 4e 45 57 4c | 49 4e 45 20 69 73 20 6e |bol NEWL|INE is n|
|00000410| 6f 72 6d 61 6c 6c 79 20 | 64 65 66 69 6e 65 64 20 |ormally |defined |
|00000420| 61 73 20 27 5c 6e 27 20 | 69 6e 20 56 69 64 65 6f |as '\n' |in Video|
|00000430| 54 6f 6f 6c 62 6f 78 2e | 68 2e 20 0d 49 6e 20 74 |Toolbox.|h. .In t|
|00000440| 68 65 20 4d 41 54 4c 41 | 42 20 65 6e 76 69 72 6f |he MATLA|B enviro|
|00000450| 6e 6d 65 6e 74 20 69 74 | 20 69 73 20 69 6e 73 74 |nment it| is inst|
|00000460| 65 61 64 20 64 65 66 69 | 6e 65 64 20 61 73 20 27 |ead defi|ned as '|
|00000470| 5c 72 27 20 66 6f 72 20 | 72 65 61 73 6f 6e 73 20 |\r' for |reasons |
|00000480| 74 68 61 74 20 61 72 65 | 20 65 78 70 6c 61 69 6e |that are| explain|
|00000490| 65 64 0d 69 6e 20 56 69 | 64 65 6f 54 6f 6f 6c 62 |ed.in Vi|deoToolb|
|000004a0| 6f 78 2e 68 2e 0d 0d 48 | 49 53 54 4f 52 59 3a 0d |ox.h...H|ISTORY:.|
|000004b0| 31 39 39 33 09 64 67 70 | 09 57 72 6f 74 65 20 42 |1993.dgp|.Wrote B|
|000004c0| 72 65 61 6b 4c 69 6e 65 | 73 2e 0d 39 2f 37 2f 39 |reakLine|s..9/7/9|
|000004d0| 33 09 64 67 70 09 57 72 | 6f 74 65 20 50 72 69 6e |3.dgp.Wr|ote Prin|
|000004e0| 74 57 72 61 70 70 65 64 | 54 65 78 74 20 61 6e 64 |tWrapped|Text and|
|000004f0| 20 50 72 69 6e 74 57 72 | 61 70 70 65 64 54 65 78 | PrintWr|appedTex|
|00000500| 74 54 6f 46 69 6c 65 20 | 62 61 73 65 64 20 6f 6e |tToFile |based on|
|00000510| 20 73 69 6d 69 6c 61 72 | 20 72 6f 75 74 69 6e 65 | similar| routine|
|00000520| 73 0d 09 09 63 61 6c 6c | 65 64 20 50 72 69 6e 74 |s...call|ed Print|
|00000530| 43 6f 6d 6d 65 6e 74 2c | 20 65 74 63 2e 2c 20 77 |Comment,| etc., w|
|00000540| 72 69 74 74 65 6e 20 62 | 79 20 64 68 62 20 61 6e |ritten b|y dhb an|
|00000550| 64 20 6a 6d 73 2e 0d 39 | 2f 31 31 2f 39 33 09 64 |d jms..9|/11/93.d|
|00000560| 67 70 20 41 64 64 65 64 | 20 50 72 69 6e 74 57 72 |gp Added| PrintWr|
|00000570| 61 70 70 65 64 43 6f 6d | 6d 65 6e 74 0d 2a 2f 0d |appedCom|ment.*/.|
|00000580| 23 69 6e 63 6c 75 64 65 | 20 22 56 69 64 65 6f 54 |#include| "VideoT|
|00000590| 6f 6f 6c 62 6f 78 2e 68 | 22 0d 0d 63 68 61 72 20 |oolbox.h|"..char |
|000005a0| 2a 42 72 65 61 6b 4c 69 | 6e 65 73 28 63 68 61 72 |*BreakLi|nes(char|
|000005b0| 20 2a 73 74 72 69 6e 67 | 2c 6c 6f 6e 67 20 6c 69 | *string|,long li|
|000005c0| 6e 65 4c 65 6e 67 74 68 | 29 0d 7b 0d 09 6c 6f 6e |neLength|).{..lon|
|000005d0| 67 20 69 2c 6c 65 66 74 | 4d 61 72 67 69 6e 2c 72 |g i,left|Margin,r|
|000005e0| 69 67 68 74 4d 61 72 67 | 69 6e 2c 6c 65 6e 67 74 |ightMarg|in,lengt|
|000005f0| 68 3b 0d 09 69 6e 74 20 | 68 65 72 65 3b 0d 09 0d |h;..int |here;...|
|00000600| 09 6c 65 66 74 4d 61 72 | 67 69 6e 3d 30 3b 0d 09 |.leftMar|gin=0;..|
|00000610| 6c 65 6e 67 74 68 3d 73 | 74 72 6c 65 6e 28 73 74 |length=s|trlen(st|
|00000620| 72 69 6e 67 29 3b 0d 09 | 77 68 69 6c 65 28 31 29 |ring);..|while(1)|
|00000630| 7b 0d 09 09 72 69 67 68 | 74 4d 61 72 67 69 6e 3d |{...righ|tMargin=|
|00000640| 6c 65 66 74 4d 61 72 67 | 69 6e 2b 6c 69 6e 65 4c |leftMarg|in+lineL|
|00000650| 65 6e 67 74 68 3b 0d 09 | 09 69 66 28 72 69 67 68 |ength;..|.if(righ|
|00000660| 74 4d 61 72 67 69 6e 3e | 3d 6c 65 6e 67 74 68 29 |tMargin>|=length)|
|00000670| 72 65 74 75 72 6e 20 73 | 74 72 69 6e 67 3b 09 09 |return s|tring;..|
|00000680| 2f 2a 20 73 75 63 63 65 | 73 73 66 75 6c 20 63 6f |/* succe|ssful co|
|00000690| 6d 70 6c 65 74 69 6f 6e | 20 2a 2f 0d 09 09 68 65 |mpletion| */...he|
|000006a0| 72 65 3d 30 3b 0d 09 09 | 69 66 28 21 68 65 72 65 |re=0;...|if(!here|
|000006b0| 29 66 6f 72 28 69 3d 6c | 65 66 74 4d 61 72 67 69 |)for(i=l|eftMargi|
|000006c0| 6e 3b 69 3c 72 69 67 68 | 74 4d 61 72 67 69 6e 3b |n;i<righ|tMargin;|
|000006d0| 69 2b 2b 29 69 66 28 73 | 74 72 69 6e 67 5b 69 5d |i++)if(s|tring[i]|
|000006e0| 3d 3d 4e 45 57 4c 49 4e | 45 29 7b 0d 09 09 09 68 |==NEWLIN|E){....h|
|000006f0| 65 72 65 3d 31 3b 0d 09 | 09 09 62 72 65 61 6b 3b |ere=1;..|..break;|
|00000700| 0d 09 09 7d 0d 09 09 69 | 66 28 21 68 65 72 65 29 |...}...i|f(!here)|
|00000710| 66 6f 72 28 3b 69 3e 3d | 6c 65 66 74 4d 61 72 67 |for(;i>=|leftMarg|
|00000720| 69 6e 3b 69 2d 2d 29 69 | 66 28 73 74 72 69 6e 67 |in;i--)i|f(string|
|00000730| 5b 69 5d 3d 3d 27 20 27 | 20 7c 7c 20 73 74 72 69 |[i]==' '| || stri|
|00000740| 6e 67 5b 69 5d 3d 3d 4e | 45 57 4c 49 4e 45 29 7b |ng[i]==N|EWLINE){|
|00000750| 0d 09 09 09 68 65 72 65 | 3d 31 3b 0d 09 09 09 62 |....here|=1;....b|
|00000760| 72 65 61 6b 3b 0d 09 09 | 7d 0d 09 09 69 66 28 21 |reak;...|}...if(!|
|00000770| 68 65 72 65 29 66 6f 72 | 28 69 3d 6c 65 66 74 4d |here)for|(i=leftM|
|00000780| 61 72 67 69 6e 3b 69 3c | 6c 65 6e 67 74 68 3b 69 |argin;i<|length;i|
|00000790| 2b 2b 29 69 66 28 73 74 | 72 69 6e 67 5b 69 5d 3d |++)if(st|ring[i]=|
|000007a0| 3d 27 20 27 20 7c 7c 20 | 73 74 72 69 6e 67 5b 69 |=' ' || |string[i|
|000007b0| 5d 3d 3d 4e 45 57 4c 49 | 4e 45 29 7b 0d 09 09 09 |]==NEWLI|NE){....|
|000007c0| 68 65 72 65 3d 31 3b 0d | 09 09 09 62 72 65 61 6b |here=1;.|...break|
|000007d0| 3b 0d 09 09 7d 0d 09 09 | 69 66 28 21 68 65 72 65 |;...}...|if(!here|
|000007e0| 29 72 65 74 75 72 6e 20 | 73 74 72 69 6e 67 3b 0d |)return |string;.|
|000007f0| 09 09 73 74 72 69 6e 67 | 5b 69 5d 3d 4e 45 57 4c |..string|[i]=NEWL|
|00000800| 49 4e 45 3b 0d 09 09 6c | 65 66 74 4d 61 72 67 69 |INE;...l|eftMargi|
|00000810| 6e 3d 69 2b 31 3b 0d 09 | 7d 0d 7d 0d 0d 2f 2a 0d |n=i+1;..|}.}../*.|
|00000820| 52 4f 55 54 49 4e 45 3a | 20 50 72 69 6e 74 57 72 |ROUTINE:| PrintWr|
|00000830| 61 70 70 65 64 54 65 78 | 74 0d 50 55 52 50 4f 53 |appedTex|t.PURPOS|
|00000840| 45 3a 0d 20 20 50 72 69 | 6e 74 73 20 6f 75 74 20 |E:. Pri|nts out |
|00000850| 74 65 78 74 2c 20 77 69 | 74 68 20 77 6f 72 64 20 |text, wi|th word |
|00000860| 77 72 61 70 70 69 6e 67 | 2e 20 4c 65 61 76 65 73 |wrapping|. Leaves|
|00000870| 20 74 68 65 20 73 75 70 | 70 6c 69 65 64 20 73 74 | the sup|plied st|
|00000880| 72 69 6e 67 20 75 6e 6d | 6f 64 69 66 69 65 64 2e |ring unm|odified.|
|00000890| 0d 2a 2f 0d 0d 76 6f 69 | 64 20 50 72 69 6e 74 57 |.*/..voi|d PrintW|
|000008a0| 72 61 70 70 65 64 54 65 | 78 74 28 46 49 4c 45 20 |rappedTe|xt(FILE |
|000008b0| 2a 73 74 72 65 61 6d 2c | 63 6f 6e 73 74 20 63 68 |*stream,|const ch|
|000008c0| 61 72 20 2a 73 29 0d 7b | 0d 09 63 68 61 72 20 2a |ar *s).{|..char *|
|000008d0| 73 54 65 6d 70 3b 0d 09 | 0d 09 73 54 65 6d 70 3d |sTemp;..|..sTemp=|
|000008e0| 6d 61 6c 6c 6f 63 28 73 | 74 72 6c 65 6e 28 73 29 |malloc(s|trlen(s)|
|000008f0| 2b 31 4c 29 3b 0d 09 69 | 66 28 73 54 65 6d 70 3d |+1L);..i|f(sTemp=|
|00000900| 3d 4e 55 4c 4c 29 50 72 | 69 6e 74 66 45 78 69 74 |=NULL)Pr|intfExit|
|00000910| 28 22 50 72 69 6e 74 57 | 72 61 70 70 65 64 54 65 |("PrintW|rappedTe|
|00000920| 78 74 3a 20 6d 61 6c 6c | 6f 63 28 25 6c 64 29 20 |xt: mall|oc(%ld) |
|00000930| 66 61 69 6c 65 64 2e 22 | 20 4e 4c 0d 09 09 2c 73 |failed."| NL...,s|
|00000940| 74 72 6c 65 6e 28 73 29 | 2b 31 4c 29 3b 0d 09 73 |trlen(s)|+1L);..s|
|00000950| 74 72 63 70 79 28 73 54 | 65 6d 70 2c 73 29 3b 0d |trcpy(sT|emp,s);.|
|00000960| 09 42 72 65 61 6b 4c 69 | 6e 65 73 28 73 54 65 6d |.BreakLi|nes(sTem|
|00000970| 70 2c 38 30 29 3b 0d 09 | 66 70 72 69 6e 74 66 28 |p,80);..|fprintf(|
|00000980| 73 74 72 65 61 6d 2c 22 | 25 73 22 2c 73 54 65 6d |stream,"|%s",sTem|
|00000990| 70 29 3b 0d 09 66 72 65 | 65 28 73 54 65 6d 70 29 |p);..fre|e(sTemp)|
|000009a0| 3b 0d 7d 0d 0d 2f 2a 0d | 52 4f 55 54 49 4e 45 3a |;.}../*.|ROUTINE:|
|000009b0| 20 50 72 69 6e 74 57 72 | 61 70 70 65 64 54 65 78 | PrintWr|appedTex|
|000009c0| 74 54 6f 46 69 6c 65 0d | 50 55 52 50 4f 53 45 3a |tToFile.|PURPOSE:|
|000009d0| 0d 20 20 41 70 70 65 6e | 64 20 77 72 61 70 70 65 |. Appen|d wrappe|
|000009e0| 64 20 74 65 78 74 20 74 | 6f 20 61 20 66 69 6c 65 |d text t|o a file|
|000009f0| 2e 0d 2a 2f 0d 0d 76 6f | 69 64 20 50 72 69 6e 74 |..*/..vo|id Print|
|00000a00| 57 72 61 70 70 65 64 54 | 65 78 74 54 6f 46 69 6c |WrappedT|extToFil|
|00000a10| 65 28 63 6f 6e 73 74 20 | 63 68 61 72 20 2a 66 69 |e(const |char *fi|
|00000a20| 6c 65 6e 61 6d 65 2c 63 | 6f 6e 73 74 20 63 68 61 |lename,c|onst cha|
|00000a30| 72 20 2a 73 29 0d 7b 0d | 09 46 49 4c 45 20 2a 73 |r *s).{.|.FILE *s|
|00000a40| 74 72 65 61 6d 3b 0d 09 | 0d 09 73 74 72 65 61 6d |tream;..|..stream|
|00000a50| 20 3d 20 66 6f 70 65 6e | 28 66 69 6c 65 6e 61 6d | = fopen|(filenam|
|00000a60| 65 2c 22 61 22 29 3b 0d | 09 69 66 20 28 73 74 72 |e,"a");.|.if (str|
|00000a70| 65 61 6d 20 3d 3d 20 4e | 55 4c 4c 29 0d 09 09 50 |eam == N|ULL)...P|
|00000a80| 72 69 6e 74 66 45 78 69 | 74 28 22 50 72 69 6e 74 |rintfExi|t("Print|
|00000a90| 57 72 61 70 70 65 64 54 | 65 78 74 54 6f 46 69 6c |WrappedT|extToFil|
|00000aa0| 65 3a 20 66 6f 70 65 6e | 28 5c 22 25 73 5c 22 2c |e: fopen|(\"%s\",|
|00000ab0| 2e 2e 2e 29 20 66 61 69 | 6c 65 64 2e 22 2c 66 69 |...) fai|led.",fi|
|00000ac0| 6c 65 6e 61 6d 65 29 3b | 0d 09 50 72 69 6e 74 57 |lename);|..PrintW|
|00000ad0| 72 61 70 70 65 64 54 65 | 78 74 28 73 74 72 65 61 |rappedTe|xt(strea|
|00000ae0| 6d 2c 73 29 3b 0d 09 66 | 63 6c 6f 73 65 28 73 74 |m,s);..f|close(st|
|00000af0| 72 65 61 6d 29 3b 0d 7d | 0d 0d 2f 2a 0d 52 4f 55 |ream);.}|../*.ROU|
|00000b00| 54 49 4e 45 3a 20 50 72 | 69 6e 74 57 72 61 70 70 |TINE: Pr|intWrapp|
|00000b10| 65 64 43 6f 6d 6d 65 6e | 74 0d 50 55 52 50 4f 53 |edCommen|t.PURPOS|
|00000b20| 45 3a 0d 20 20 50 72 69 | 6e 74 73 20 6f 75 74 20 |E:. Pri|nts out |
|00000b30| 61 20 63 6f 6d 6d 65 6e | 74 2c 20 77 69 74 68 20 |a commen|t, with |
|00000b40| 77 6f 72 64 20 77 72 61 | 70 70 69 6e 67 2e 0d 2a |word wra|pping..*|
|00000b50| 2f 0d 0d 76 6f 69 64 20 | 50 72 69 6e 74 57 72 61 |/..void |PrintWra|
|00000b60| 70 70 65 64 43 6f 6d 6d | 65 6e 74 28 46 49 4c 45 |ppedComm|ent(FILE|
|00000b70| 20 2a 73 74 72 65 61 6d | 2c 63 6f 6e 73 74 20 63 | *stream|,const c|
|00000b80| 68 61 72 20 2a 73 29 0d | 7b 0d 09 63 68 61 72 20 |har *s).|{..char |
|00000b90| 2a 73 54 65 6d 70 3b 0d | 09 0d 09 73 54 65 6d 70 |*sTemp;.|...sTemp|
|00000ba0| 3d 6d 61 6c 6c 6f 63 28 | 73 74 72 6c 65 6e 28 73 |=malloc(|strlen(s|
|00000bb0| 29 2b 36 4c 29 3b 0d 09 | 69 66 28 73 54 65 6d 70 |)+6L);..|if(sTemp|
|00000bc0| 3d 3d 4e 55 4c 4c 29 50 | 72 69 6e 74 66 45 78 69 |==NULL)P|rintfExi|
|00000bd0| 74 28 22 50 72 69 6e 74 | 43 6f 6d 6d 65 6e 74 53 |t("Print|CommentS|
|00000be0| 74 72 69 6e 67 3a 20 6d | 61 6c 6c 6f 63 28 25 6c |tring: m|alloc(%l|
|00000bf0| 64 29 20 66 61 69 6c 65 | 64 2e 22 20 4e 4c 0d 09 |d) faile|d." NL..|
|00000c00| 09 2c 73 74 72 6c 65 6e | 28 73 29 2b 36 4c 29 3b |.,strlen|(s)+6L);|
|00000c10| 0d 09 73 74 72 63 70 79 | 28 73 54 65 6d 70 2c 22 |..strcpy|(sTemp,"|
|00000c20| 2f 2a 20 22 29 3b 0d 09 | 73 74 72 63 61 74 28 73 |/* ");..|strcat(s|
|00000c30| 54 65 6d 70 2c 73 29 3b | 0d 09 73 74 72 63 61 74 |Temp,s);|..strcat|
|00000c40| 28 73 54 65 6d 70 2c 22 | 20 2a 2f 22 20 4e 4c 29 |(sTemp,"| */" NL)|
|00000c50| 3b 0d 09 50 72 69 6e 74 | 57 72 61 70 70 65 64 54 |;..Print|WrappedT|
|00000c60| 65 78 74 28 73 74 72 65 | 61 6d 2c 73 54 65 6d 70 |ext(stre|am,sTemp|
|00000c70| 29 3b 0d 09 66 72 65 65 | 28 73 54 65 6d 70 29 3b |);..free|(sTemp);|
|00000c80| 0d 7d 0d 0d 2f 2a 0d 52 | 4f 55 54 49 4e 45 3a 20 |.}../*.R|OUTINE: |
|00000c90| 50 72 69 6e 74 57 72 61 | 70 70 65 64 43 6f 6d 6d |PrintWra|ppedComm|
|00000ca0| 65 6e 74 54 6f 46 69 6c | 65 0d 50 55 52 50 4f 53 |entToFil|e.PURPOS|
|00000cb0| 45 3a 0d 20 20 41 70 70 | 65 6e 64 20 77 72 61 70 |E:. App|end wrap|
|00000cc0| 70 65 64 20 63 6f 6d 6d | 65 6e 74 20 74 6f 20 61 |ped comm|ent to a|
|00000cd0| 20 66 69 6c 65 2e 0d 2a | 2f 0d 0d 76 6f 69 64 20 | file..*|/..void |
|00000ce0| 50 72 69 6e 74 57 72 61 | 70 70 65 64 43 6f 6d 6d |PrintWra|ppedComm|
|00000cf0| 65 6e 74 54 6f 46 69 6c | 65 28 63 6f 6e 73 74 20 |entToFil|e(const |
|00000d00| 63 68 61 72 20 2a 66 69 | 6c 65 6e 61 6d 65 2c 63 |char *fi|lename,c|
|00000d10| 6f 6e 73 74 20 63 68 61 | 72 20 2a 73 29 0d 7b 0d |onst cha|r *s).{.|
|00000d20| 09 46 49 4c 45 20 2a 73 | 74 72 65 61 6d 3b 0d 09 |.FILE *s|tream;..|
|00000d30| 0d 09 73 74 72 65 61 6d | 20 3d 20 66 6f 70 65 6e |..stream| = fopen|
|00000d40| 28 66 69 6c 65 6e 61 6d | 65 2c 22 61 22 29 3b 0d |(filenam|e,"a");.|
|00000d50| 09 69 66 20 28 73 74 72 | 65 61 6d 20 3d 3d 20 4e |.if (str|eam == N|
|00000d60| 55 4c 4c 29 0d 09 09 50 | 72 69 6e 74 66 45 78 69 |ULL)...P|rintfExi|
|00000d70| 74 28 22 50 72 69 6e 74 | 57 72 61 70 70 65 64 43 |t("Print|WrappedC|
|00000d80| 6f 6d 6d 65 6e 74 54 6f | 46 69 6c 65 3a 20 66 6f |ommentTo|File: fo|
|00000d90| 70 65 6e 28 5c 22 25 73 | 5c 22 2c 2e 2e 2e 29 20 |pen(\"%s|\",...) |
|00000da0| 66 61 69 6c 65 64 2e 22 | 2c 66 69 6c 65 6e 61 6d |failed."|,filenam|
|00000db0| 65 29 3b 0d 09 50 72 69 | 6e 74 57 72 61 70 70 65 |e);..Pri|ntWrappe|
|00000dc0| 64 43 6f 6d 6d 65 6e 74 | 28 73 74 72 65 61 6d 2c |dComment|(stream,|
|00000dd0| 73 29 3b 0d 09 66 63 6c | 6f 73 65 28 73 74 72 65 |s);..fcl|ose(stre|
|00000de0| 61 6d 29 3b 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |am);.}..|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000e10| 06 09 f6 4d 00 00 26 00 | 00 00 98 00 00 13 00 00 |...M..&.|........|
|00000e20| 81 a9 3a 9e 0d 44 65 6e | 69 73 20 50 72 69 76 61 |..:..Den|is Priva|
|00000e30| 0c 42 72 65 61 6b 4c 69 | 6e 65 73 2e 63 69 02 00 |.BreakLi|nes.ci..|
|00000e40| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 3c 00 60 |..TEXTCW|IE...<.`|
|00000e50| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 3c 00 60 |..TEXTCW|IE...<.`|
|00000e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e70| 00 00 a9 8b 11 c1 00 00 | 0d 67 00 00 01 9a 00 00 |........|.g......|
|00000e80| 00 00 00 0f e2 00 00 00 | 00 6b 00 00 00 00 00 00 |........|.k......|
|00000e90| 00 00 00 3f 88 00 00 6b | 01 ac 00 00 00 00 00 00 |...?...k|........|
|00000ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 03 | 00 04 00 56 00 0a 01 dc |........|...V....|
|00000f30| 02 80 00 56 00 0a 01 dc | 02 80 ab 31 05 f1 00 00 |...V....|...1....|
|00000f40| 00 00 00 00 00 02 00 00 | 00 00 01 00 00 00 00 04 |........|........|
|00000f50| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00000f60| 00 00 00 46 00 b8 5c 88 | 3a 06 00 00 00 1c 00 46 |...F..\.|:......F|
|00000f70| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000f80| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00000f90| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00000fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+